Class SetupController
java.lang.Object
cpsc2150.extendedConnectX.controllers.SetupController
This class is the controller for our setup screen. The
processButtonClick method is called by
SetupView when someone clicks on the submit button. It is passed in the rows, cols, players and
the number to win by the view, but it still needs to validate that input. If there are any
errors it can use the displayError method in the SetupView class to inform the player of the
error, then wait for them to fix it and resubmit.
If there are no errors it will create a new IGameBoard object (the implementation will depend on
the size of the game board) to serve as the model, and the ConnectXController and ConnectXView.
Control is then passed over the event dispatch thread that will wait for an event to occur
No changes need to be made to this class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprocessButtonClick(int rows, int cols, int players, int numWin) This processes the submit button click.
-
Constructor Details
-
SetupController
This creates a new setup controller.
- Parameters:
v- The setup view associated with this controller.
-
-
Method Details
-
processButtonClick
public void processButtonClick(int rows, int cols, int players, int numWin) This processes the submit button click.
- Parameters:
rows- Number of rows for the boardcols- Number of columns for the boardplayers- Number of players for this gamenumWin- Number of tokens in a row required to win
-